Skip to content

HAL: serial nor: more guards in case of WSPI - #61

Merged
dron0gus merged 1 commit into
rusefi:stable_21.11.x.rusefi_clean_historyfrom
dron0gus:fix-wspi
Jul 12, 2025
Merged

dron0gus merged 1 commit into
rusefi:stable_21.11.x.rusefi_clean_historyfrom
dron0gus:fix-wspi

Conversation

@dron0gus

Copy link
Copy Markdown
Member

No description provided.

@dron0gus
dron0gus merged commit 5c1a915 into rusefi:stable_21.11.x.rusefi_clean_history Jul 12, 2025
@dron0gus
dron0gus deleted the fix-wspi branch July 12, 2025 09:25
dron0gus pushed a commit to dron0gus/ChibiOS that referenced this pull request Sep 4, 2026
…usefi#66)

🤖 chibios-sheriff — backport (advisory)

Backport of **rusefi#61** (main commit `2447f6a`) to `stable-21.11.x`.
Stable's `ch.hpp` carries the same defects, so this is a real fix
backport.

**Fixes**
- `Scheduler::rescheduleS()` now actually calls `chSchRescheduleS()`
(was a no-op function *declaration*).
- Typed `Mailbox<T>` `fetch`/`peek` no longer overrun the caller's
storage when `sizeof(T) < sizeof(msg_t)` — the **memory-corruption** fix
(fetch into a local `msg_t`, narrow on `MSG_OK`); `post`/`peek` use
value casts.
- `ObjectsPool` rounds its object size up to pointer alignment (the
free-list stores a next-pointer per slot).
- The synchronization wrappers are no longer copyable, and the
`Registry::nextThread()` reference handoff is corrected.

**Adaptation:** none — cherry-pick auto-merged cleanly (stable's
`ch.hpp` matches main's structure). The `nextThread` handoff fix is
semantically correct here because stable's registry iterators are
reference-counting since rusefi#54.

**Local gates** (stable has no CI): `RT-STM32F407-DISCOVERY-G++` builds
clean (g++ 14.3.1); a compile-only probe instantiating
`Mailbox<uint8_t,8>` and `ObjectsPool<uint8_t,4>`
(`post`/`fetch`/`alloc`) compiles clean — exercising the small-T
template fixes. (`.hpp` is not in the CI style glob.)

**Changelog:** none — `os/various/cpp_wrappers` is not changelog-tracked
(matches rusefi#61 on main, which added no entry).

Sheriff-authored backport — a human reviews/merges.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rusefillc pushed a commit that referenced this pull request Sep 21, 2026
…66)

🤖 chibios-sheriff — backport (advisory)

Backport of **#61** (main commit `2447f6a`) to `stable-21.11.x`.
Stable's `ch.hpp` carries the same defects, so this is a real fix
backport.

**Fixes**
- `Scheduler::rescheduleS()` now actually calls `chSchRescheduleS()`
(was a no-op function *declaration*).
- Typed `Mailbox<T>` `fetch`/`peek` no longer overrun the caller's
storage when `sizeof(T) < sizeof(msg_t)` — the **memory-corruption** fix
(fetch into a local `msg_t`, narrow on `MSG_OK`); `post`/`peek` use
value casts.
- `ObjectsPool` rounds its object size up to pointer alignment (the
free-list stores a next-pointer per slot).
- The synchronization wrappers are no longer copyable, and the
`Registry::nextThread()` reference handoff is corrected.

**Adaptation:** none — cherry-pick auto-merged cleanly (stable's
`ch.hpp` matches main's structure). The `nextThread` handoff fix is
semantically correct here because stable's registry iterators are
reference-counting since #54.

**Local gates** (stable has no CI): `RT-STM32F407-DISCOVERY-G++` builds
clean (g++ 14.3.1); a compile-only probe instantiating
`Mailbox<uint8_t,8>` and `ObjectsPool<uint8_t,4>`
(`post`/`fetch`/`alloc`) compiles clean — exercising the small-T
template fixes. (`.hpp` is not in the CI style glob.)

**Changelog:** none — `os/various/cpp_wrappers` is not changelog-tracked
(matches #61 on main, which added no entry).

Sheriff-authored backport — a human reviews/merges.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant